package com.logistics.modules.transportationManagement.controller;

import java.util.Arrays;
import java.util.Map;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.logistics.modules.transportationManagement.entity.ClientorderdetailsEntity;
import com.logistics.modules.transportationManagement.service.ClientorderdetailsService;
import com.logistics.common.utils.PageUtils;
import com.logistics.common.utils.R;



/**
 * 
 *
 * @author HURRICANE
 * @email HURRICANE@nb.com
 * @date 2022-05-13 15:13:36
 */
@RestController
@RequestMapping("transportationManagement/clientorderdetails")
public class ClientorderdetailsController {
    @Autowired
    private ClientorderdetailsService clientorderdetailsService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params){

        PageUtils page = clientorderdetailsService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Integer id){

		ClientorderdetailsEntity clientorderdetails = clientorderdetailsService.getById(id);

        return R.ok().put("clientorderdetails", clientorderdetails);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody ClientorderdetailsEntity clientorderdetails){

		clientorderdetailsService.save(clientorderdetails);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody ClientorderdetailsEntity clientorderdetails){

		clientorderdetailsService.updateById(clientorderdetails);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer id){

		clientorderdetailsService.removeByIds(Arrays.asList(id));

        return R.ok();
    }

}
